package chapter23.homework02;
public class Secondary extends State{
    public Secondary(State pri){
        this.rankName = "熟练级";
        this.player = pri.player;
        this.point = pri.point;
    }

    @Override
    public void checkState(int point) {
        if(point < 30){
            player.setState(new Primary(this));//当分数小于30时，返回当前的上一个状态
        }else if(point >= 50){
            player.setState(new Pro(this));//进入下一个状态...
        }
    }

    @Override
    public void doubleScore() {
        System.out.println(rankName + "玩家" + player.getName() + "使用积分翻倍 +30");
        //实现积分翻倍，进入下一关...
        point += 30;
        checkState(point);
    }
}
